import VueRouter from 'vue-router'

// 调入模块
import HomeContainer from "../src/components/appmain/HomeContainer.vue"
import MemberContainer from "../src/components/appmain/MemberContainer.vue"
import ShopcarContainer from "../src/components/appmain/ShopcarContainer.vue"
import SearchContainer from "../src/components/appmain/SearchContainer.vue"
import NewsList from "../src/components/news/NewsList.vue"
import NewsInfo from "../src/components/news/NewsInfo.vue"
import PhotosList from "../src/components/photos/PhotosList.vue"
import PhotosDetial from "../src/components/photos/PhotosDetail.vue"
import GoodsList from "../src/components/goods/GoodsList.vue"
import GoodsDetail from "../src/components/goods/GoodsDetail.vue"
import GoodsDes from "../src/components/goods/GoodsDes.vue"
import GoodsComment from "../src/components/goods/GoodsComment.vue"

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    {path: "/", redirect: "/home"},
    {path: "/home", component: HomeContainer},
    {path: "/member", component: MemberContainer},
    {path: "/shopcar", component: ShopcarContainer},
    {path: "/search", component: SearchContainer},
    {path: "/home/newslist", component: NewsList},
    {path: "/home/newsinfo/:id", component: NewsInfo},
    {path: "/home/photoslist", component: PhotosList},
    {path: "/home/photosdetail/:id", component: PhotosDetial},
    {path: "/home/goodslist", component: GoodsList},
    {path: "/home/goodsdetail/:id", component: GoodsDetail},
    {path: "/home/goodsdes/:id", component: GoodsDes, name: "goodsdes"},
    {path: "/home/goodscomment/:id", component:GoodsComment, name: "goodscomment"}
  ],
  linkActiveClass: "mui-active"
})

// 把路由对象暴露出去
export default router